package overwrite;

/**
 * @author shkstart
 * @date 2022/5/9 - 21:42
 */
public class Person {
    String name;
    int age;


    public Person() {

    }

    public Person(String name, int age) {
        this.name = name;
        this.age =age;
    }

// 对父类中的eat()方法进行重写
    public void eat() {
        System.out.println("吃饭");
    }

    public void walk(int distance) {
        System.out.println("走路，走的距离是:" + distance + "公里");
    }

    public int d1() {
        return age;
    }

    public Object s() {
        return name;
    }

}
